home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CShotHellFire extends CShot
- {
-
-
- private var mPath:CPath;
-
- private var mImpactDistance:Number;
-
- private var mFlare:CThingAnimation;
-
- private var mExplode:Boolean;
-
- public function CShotHellFire(param1:CPosition, param2:*)
- {
- super(param1);
- mType = "hellfire";
- Process = Process_Normal;
- mAngle = new CAngle();
- mDelta = new CPosition();
- mMaxLife = mLife = 100;
- mMaxSpeed = 400 * mSpriteScalar;
- mSpeed = 0;
- mAcceleration = 10;
- mOrientation = 1;
- mShowOnMap = true;
- AddAnimation("stand",HellFire,"AddSprite_Black");
- AddThing(mFlare = new CThingAnimation(HellFire_Flare,"AddSprite_Scale"));
- mFlare.mInvisible = true;
- §§push(§§findproperty(mTarget));
- if(true)
- {
- §§pop().mTarget = param2 is CPosition ? param2 : param2.mPosition;
- SetState("FOLLOWPATH");
- mTrailPoints = [];
- IncrementFired();
- return;
- }
- §§goto(addr86);
- }
-
- public function State_DROP() : void
- {
- mDelta.y += 0.2;
- mPosition.Add(mDelta);
- if(mStateCount <= 0)
- {
- SetState("FOLLOWPATH");
- }
- }
-
- public function State_DROP_Enter() : void
- {
- if(true)
- {
- mStateCount = SECONDS / 5;
- }
- }
-
- public function Process_Die() : *
- {
- mDead = true;
- DispatchDispose();
- }
-
- public function State_DROP_Exit() : void
- {
- }
-
- public function State_FOLLOWPATH_Enter() : void
- {
- if(true)
- {
- mFlare.mInvisible = false;
- if(true)
- {
- mPath = new CPath();
- mPath.SetPath([mPosition,new Point((mPosition.x + mTarget.x) * 0.5,(mPosition.y + mTarget.y) * 0.45),mTarget]);
- }
- mPath.OrientateThing(this);
- }
- }
-
- public function State_FOLLOWPATH_Exit() : void
- {
- }
-
- public function CreateExplosion() : void
- {
- if(true)
- {
- AddThing(new CEffectExplosionMedium(mPosition,100));
- if(true)
- {
- mDead = true;
- }
- DispatchDispose();
- }
- }
-
- override public function Draw() : void
- {
- var _loc1_:Matrix = null;
- var _loc2_:Point = null;
- super.Draw();
- if(!mFlare.mInvisible)
- {
- DrawTrail(2,150);
- }
- _loc1_ = GetOrientationMatrix();
- DrawSprite(_loc1_);
- if(!mFlare.mInvisible)
- {
- _loc2_ = _loc1_.transformPoint(mSprite.mObjects["flare"].mPosition);
- mFlare.mPosition.SetXY(_loc2_.x + mPosition.x,_loc2_.y + mPosition.y);
- mFlare.mAngle.Copy(mAngle);
- mFlare.Draw();
- }
- }
-
- public function Process_Normal() : void
- {
- var _loc1_:Point = null;
- if(true)
- {
- Accelerate_Speed();
- if(true)
- {
- if(Process_State != null)
- {
- if(true)
- {
- Process_State();
- if(true)
- {
- addr27:
- if(mDisposed)
- {
- if(true)
- {
- return;
- }
- }
- else
- {
- if(mFlare.mInvisible ? MapMove() : MapMoveTrail())
- {
- addr43:
- if(!mMap.InMap(mPosition.x,mPosition.y))
- {
- addr57:
- Dispose();
- }
- §§goto(addr59);
- }
- addr59:
- Process_Children();
- §§goto(addr61);
- }
- §§goto(addr35);
- }
- §§goto(addr43);
- }
- §§goto(addr57);
- }
- §§goto(addr27);
- }
- §§goto(addr57);
- }
- addr61:
- _loc1_ = OrientatePoint(mSprite.mObjects["payload"].mPosition.clone(),mPosition);
- if(_loc1_.y >= mLandscape.GetAltitude(_loc1_.x))
- {
- mPosition.SetXY(_loc1_.x,mLandscape.GetAltitude(_loc1_.x));
- mExplode = true;
- }
- if(mDead || mExplode)
- {
- CreateExplosion();
- }
- }
-
- public function State_FOLLOWPATH() : void
- {
- var _loc1_:Number = NaN;
- if(true)
- {
- mExplode = Math.abs(mTarget.x - mPosition.x) <= mSpeed;
- if(true)
- {
- if(mExplode)
- {
- if(true)
- {
- addr46:
- _loc1_ = mTarget.x - mPosition.x;
- if(mPath.MoveAlong(_loc1_))
- {
- mPath.OrientateThing(this);
- }
- §§goto(addr66);
- }
- mExplode = true;
- §§goto(addr62);
- }
- else
- {
- §§push(mSpeed);
- }
- §§goto(addr46);
- }
- addr62:
- §§goto(addr66);
- }
- addr66:
- }
- }
- }
-